package org.jeecg.modules.simulator.factory;

import lombok.Getter;
import lombok.Setter;
import org.jeecg.modules.simulator.jsonot.NumPeopEnStationApiInfo;
import org.jeecg.modules.simulator.jsonot.ODProbabilityApiInfo;
import org.jeecg.modules.simulator.jsonot.PsgStationDistributionInfo;
import org.jeecg.modules.simulator.model.SceneParam;
import org.jeecg.modules.simulator.model.line.station.station.Station;
import org.jeecg.modules.simulator.model.line.station.station.TransferStation;
import org.jeecg.modules.simulator.service.HistoryBizPersonLoaderService;
import org.jeecg.modules.simulator.util.UnitCache;

import java.util.Collections;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class LoadAllDayPersonHistory implements LoadHistoryPersonData {
    @Setter
    HistoryBizPersonLoaderService historyBizPersonLoaderService;//历史人员数据

    //    全天每秒刷卡进站人数
    @Getter
    @Setter
    Map<String, Map<String, NumPeopEnStationApiInfo>> numPeopEnStationApiInfoMap = new HashMap<>();
    @Getter
    @Setter
    Map<String, List<ODProbabilityApiInfo>> odProbabilityApiInfoMap = new HashMap<>();
    @Override
    public void loadHistoryPerson(String sceneCode) {
        loadEntryStationNum(sceneCode);
        loadODAssignPerson(sceneCode);



    }



    public void loadEntryStationNum(String sceneCode) {
        SceneParam sceneparam = UnitCache.sceneParamMap.get(sceneCode);
        //4、一个时间段内每秒刷卡进站人数
        historyBizPersonLoaderService.loadNumPeopleEnByEndStation(sceneparam.getSceneDate(),  sceneparam.getEndTimeStr());
        numPeopEnStationApiInfoMap = historyBizPersonLoaderService.getNumPeopEnStationApiInfoMap();
    }
    public void loadODAssignPerson(String sceneCode) {
        SceneParam sceneparam = UnitCache.sceneParamMap.get(sceneCode);
        //1、各站人员OD分配概率
        historyBizPersonLoaderService.getRouteStatistics(sceneparam.getSceneDate(), sceneparam.getStartTimeStr(), sceneparam.getEndTimeStr());
        odProbabilityApiInfoMap = historyBizPersonLoaderService.getOdProbabilityApiInfoMap();
    }

    @Override
    public Map<String, List<PsgStationDistributionInfo>> getPsgStationDistributionInfoMap() {
        return Collections.emptyMap();
    }


    public void loadData() {



    }
}
